package com.x.erp.dao;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.x.erp.thirdparty.CarMappingQczj;
import com.x.framework.dao.BaseDao;

/**
 * 与汽车之家车辆关系映射
 * @author gdf
 *
 */
@Repository
public class CarMappingQczjDao extends BaseDao{
	
	private final static String selectQczjCarSql = "SELECT T1.* FROM ERP_CAR_MAPPING_QCZJ T1 WHERE 1=1 ";
	
	public List<CarMappingQczj> selectQczjCar(CarMappingQczj carMappingQczj) throws Exception{
		StringBuilder sb = new StringBuilder(selectQczjCarSql);
		List<Object> params = new ArrayList<Object>();
		if(this.isString(carMappingQczj.getCarId())){
			sb.append("AND T1.CAR_ID = ? ");
			params.add(carMappingQczj.getCarId());
		}
		if(this.isNotNull(carMappingQczj.getMappingCarId())){
			sb.append("AND T1.MAPPING_CAR_ID = ? ");
			params.add(carMappingQczj.getMappingCarId());
		}
		return this.queryForList(sb.toString(), CarMappingQczj.class, params);
	}

}
